#include <iostream>
#include <iterator>
#include <utility>
#include <algorithm>
#include "../vec2d.h"
using namespace std;

int main()
{
    vec2d<int> a(2,3);
    a = 1;
    a(0, 0) = 0;
    a(1, 2) = 8;
    cout <<"a: " << "\t";
    copy(a.begin(), a.end(), ostream_iterator<int>{cout, "\t"});
    cout << "\n";

    vec2d<int> c {a};
    c(1,1) = 2;
    cout <<"c: " << "\t";
    copy(c.begin(), c.end(), ostream_iterator<int>{cout, "\t"});
    cout << "\n";

    vec2d<int> d{move(c)};
    cout <<"d: " << "\t";
    copy(d.begin(), d.end(), ostream_iterator<int>{cout, "\t"});
    cout << "\n";

    vec2d<int> e = a;
    cout <<"e: " << "\t";
    copy(e.begin(), e.end(), ostream_iterator<int>{cout, "\t"});
    cout << "\n";
    // 试一下 assert
    // cout << a(3,3) << "\n";

    // 下面没有报错， 但出现了明显的延迟或停顿
    // cout << c(0, 0) << "\n"; 

    return 0;
}